﻿@{
    IList<string> userRoles = Model.Roles;
}

@foreach (var item in ViewBag.AllRoles as IList<string>)
{
    <tr>
        <td>
            @item
        </td>
        <td>
            @if (userRoles.Contains(item))
            { 
                <input type="checkbox" name="@item" checked="checked"/>
            }
            else 
            {
                <input type="checkbox" name="@item" /> 
            }
            
        </td>
    </tr> 
}